﻿using UnityEngine;

namespace CinemachineExtend
{
    [System.Serializable]
    public class SingleCameraMove
    {
        public const float MinDuration = 0.1f;

        public bool b_idle;
        public bool b_localSpace;
        public bool b_immediate;
        public float duration;
        public Vector3 destination;

        public SingleCameraMove()
        {
            b_idle = true;
            b_localSpace = false;
            b_immediate = true;
        }

        public SingleCameraMove(float _duration, Vector3 _destination, bool _idle = false, bool _localSpace = false, bool _immediate = false)
        {
            duration = _duration;
            destination = _destination;
            b_idle = _idle;
            b_localSpace = _localSpace;
            b_immediate = _immediate;
        }

        public static CameraMove operator +(SingleCameraMove s1, SingleCameraMove s2)
        {
            CameraMove c = new CameraMove();
            c.singleCameraMoves.Add(s1);
            if (s2 != null)
                c.singleCameraMoves.Add(s2);
            return c;
        }
    }
}